<h3><?php echo $this->title?></h3>
<div class="upload-image">
<div style="color:red;" id="edit_message"><?php echo $this->errMessage;?></div>
<form action="/admin/workshop/list" method="get">
    <h4>Tìm kiếm hội thảo</h4>
    <table class="table table-condensed">
        <tr>
            <td><label for="id">Id:</label></td>
            <td><input type="text" id="id" name="id" value="<?php echo $this->params['id'];?>" /></td>
        </tr>
        <tr>
            <td><label for="active">Hiện trên web</label></td>
            <td>
                <select id="active" name="active">
                    <option value="0" <?php echo 0 == $this->params['active']?"selected='selected'":""?>>[Tất cả]</option>
                    <option value="1" <?php echo 1 == $this->params['active']?"selected='selected'":""?>>Có</option>
                    <option value="2" <?php echo 2 == $this->params['active']?"selected='selected'":""?>>Không</option>
                </select>
            </td>
        </tr>
    </table>
    <div class="control-group">
        <div class="controls">
          <button type="submit" class="btn">Tìm</button>
        </div>
  </div>
</form>
<a href="/admin/workshop/edit" style="font-weight: bold">Tạo mới</a>
<?php if(is_array($this->workshops)) {?>
    <table class="table table-bordered table-striped">
        <thead>
              <tr>
                <th>Tiêu đề</th>
                <th>Hiện trên web</th>
                <th>Order</th>
                <td>Ngày diễn ra</td>
                <td>Địa điểm</td>
                <th>Ngày cập nhật</th>
                <th>Ngày tạo</th>
                <th>Thao tác</th>
              </tr>
        </thead>
        <tbody>
            <?php foreach($this->workshops as $workshop) :?>
             <tr>
                 <td><?php echo $workshop['content']?></td>
                 <td>
                     <?php if($workshop['active']) {?>
                     <i class="icon-ok"></i>
                     <?php } else {?>
                     <i class="icon-lock"></i>
                     <?php }?>
                 </td>
                 <td>
                     <?php echo $workshop['order'];?>
                 </td>
                 <td>
                     <?php echo date('d-m-Y', $workshop['workshop_date']);?>
                 </td>
                 <td>
                     <?php echo $workshop['location'];?>
                 </td>
                 <td>
                     <?php echo date('d-m-Y', $workshop['last_update']);?>
                 </td>
                 <td>
                     <?php echo date('d-m-Y', $workshop['dateline']);?>
                 </td>
                 <td>
                     <a href="/admin/workshop/edit/id/<?php echo $workshop['id']?>">
                         <i class="icon-edit"></i>
                     </a>
                     <a href="/admin/workshop/delete/id/<?php echo $workshop['id']?>" onclick="return confirm('sure?');">
                         <i class="icon-remove"></i>
                     </a>
                 </td>
             </tr>
             <?php endforeach;?>
        </tbody>
      </table>
      <?php echo $this->paginationcontrol2($this->page, $this->totalItem, $this->numRowPerPage, 'pagination.phtml', $this->currentUrl);?>
</div>
<?php } else {?>
<div>Không có hội thảo nào!</div>
<?php }?>
